<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:include="public/page_css::page_css ('收货人详情查看')"/>
<meta charset="UTF-8"/>
<title>Title</title>
<!-- load css -->

<link rel="stylesheet" type="text/css" th:href="@{/plugin/layui/css/font/iconfont.css}" media="all"/>
<link rel="stylesheet" type="text/css" th:href="@{/plugin/layui/js/layui/css/layui.css}" media="all"/>
<link rel="stylesheet" type="text/css" th:href="@{/css/main.css}" media="all"/>
<body>

<div id="div4" >
    <div class="layui-fluid larry-wrapper">
        <!--<div style="    margin-left: 10px;font-weight: bold;">
            <h4> 所属仓库管理</h4>
        </div>-->
        <div class="layui-card">
            <form class="layui-form layui-card-header  layui-card-header-auto" id="searchForm3">
                <input type="hidden" th:value="${sskhid}" id="sskhid3" name="sskhid">
            </form>
            <div>
                <!--列表-->
                <section class="panel panel-padding layui-card-body" >
                    <div class="pro">
                        <table id="table3"  class="table text-nowrap" style="word-break:break-all; word-wrap:break-word;"></table>
                    </div>
                </section>
                <div class="group-button" style="float:right;margin-bottom: 10px">
                    <a class="layui-btn layui-btn-sm layui-btn-normal warehouseSave">
                        <i class="layui-icon">&#x1005;</i> 保存
                    </a>
                    <a class="layui-btn layui-btn-sm layui-btn-normal warehouseSaveCloses">
                        <i class="layui-icon">&#x1005;</i> 取消
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
<script type="text/javascript" th:src="@{/plugin/layui/js/layui/layui.js}"></script>
<script type="text/javascript" th:src="@{/plugin/layui/js/version.js}"></script>
<script th:src="@{/plugin/layui/js/common.js}"></script>
<div th:include="public/public_js::public_js"></div>

<script>
    //	回车查询
    document.onkeydown = function(event) {
        e = event ? event : (window.event ? window.event : null);
        if (e.keyCode == 13) {
            //执行的方法
            $('#search_button').click();
            $('#search_button2').click();
        }
    };

    layui.use(['myform', 'zzpUtils', 'form'], function () {
        var form = layui.form,
            zzpUtils = layui.zzpUtils;


        window.operateEvent ={

        }

        var $table3 = zzpUtils.table({
            elem: '#table3',
            isApi: true,
            pagination:false,
            url: '/wmsCustomerFileWarehouse/list',
            columns: [
                {
                    field: '',
                    checkbox: true,
                    clickToSelect:true
                }, {
                    field: 'name',
                    title: '仓库名称'
                }],
            queryParams: function () {//查询条件
                return  zzpUtils.getFormJson($("#searchForm3"));
            },
            detailFormatter: function (index, row) {
                return "这里就没有确定过11";
            },
        });

        $(".warehouseSave").on('click', function () {
            var ids = [];
            var formJson={};
            var rows=$("#table3").bootstrapTable('getSelections');
            rows.forEach(function(value,index,array){
                ids.push(value.id);
            });
            formJson={"id":$("#sskhid3").val(),"ids":ids};
            $.ajax({
                type: 'post',
                url: '/zxsdwms/wmsCustomerFileWarehouse/save',
                contentType: "application/json",
                async: false,
                data: JSON.stringify(formJson),
                success: function (res) {
                    zzpUtils.refreshTable("#table3");
                    setTimeout(function(){
                        top.layer.msg(res.title+","+res.message);
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index); //再执行关闭
                        console.info(data);

                        //刷新父页面
                    },500);
                }
            })
        });


    });



</script>
</html>